﻿/*
This file is under Microsoft Public License (MS-PL)
Copyright Yohann MARTEL.  All rights reserved.
Codeplex: http://amf.codeplex.com
AMF Website: http://www.ymartel.com/aspnet-mobile-framework/
*/
using System.Web.UI;

namespace Mobile.WebControls.Field
{
    public class InputItem : ThemedControl
    {
        #region Properties
        public InputType InputType { get; set; }
        public string FieldName { get; set; }
        public string FieldValue { get; set; }
        public string LabelText { get; set; }
        #endregion

        #region Methods
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Label label = new Label();
            label.Text = LabelText;
            Controls.Add(label);
            InputControl inputControl = new InputControl();
            inputControl.Value = FieldValue;
            inputControl.FieldName = FieldName;
            inputControl.InputType = InputType;
            Controls.Add(inputControl);
            label.ForId = inputControl.ClientID;
 

        }
        #endregion

        #region Render Methods
        public override void RenderBeginTag(HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
        }

        public override void RenderEndTag(HtmlTextWriter writer)
        {
        }
        #endregion
    }
}
